import Vue from 'vue'
import Router from 'vue-router'
import index from '@/view/index'
import login from '@/view/login'
import main from '@/view/main'
import tj from '@/view/tj'
import yy from '@/view/yy'
import rq from '@/view/rq'
import yp from '@/view/yp'
import ss from '@/view/ss'

Vue.use(Router)

export default new Router({
  mode: 'history',
  routes: [
    {
      path: '/',
      name: '首页',
      component: index
    },
    {
      path: '/login',
      name: '登录',
      component: login
    },
    {
      path: '/main',
      name: '主页',
      component: main,
      children:[
        {
          path: '/yy',
          name: '应用',
          component: yy,
          meta: { index: 1 }
        },
        {
          path: '/rq',
          name: '人群',
          component: rq,
          meta: { index: 2 }
        },
        {
          path: '/yp',
          name: '云盘',
          component: yp,
          meta: { index: 3 }
        }, 
        {
          path: '/tj',
          name: '统计',
          component: tj,
          meta: { index: 4 }
        },
        {
          path: '/ss',
          name: '搜索',
          component: ss,
          meta: { index: 5 }
        }
      ]
    }
  ]
})
